﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using UnityEngine;

public class FlowVo
{
    //攻击方pos点//
    public int attackPos;

   //被攻击方pos点//
    public int targetPos;

    //技能//
    public string skill;


    //伤害//
    public List<DamageVo> damageVos= new List<DamageVo>();

    //主角mp//
    public int mp;

    public int bufferhp;

    public int buffermp;

    //主角buff//
    public string buffer;

    public int doubleHit = 0;

    public FlowVo(string pos, string targetpos, string skill, string mp, string bufferhp, string buffermp, string buffer, XmlNodeList damageXml)
    {
        this.mp = int.Parse(mp);
        this.buffer = buffer;
        this.attackPos = int.Parse(pos);
        this.targetPos = int.Parse(targetpos);
        this.skill = skill;
        this.bufferhp = 0;
        this.buffermp = int.Parse(buffermp);

        for (int j = 0; j < damageXml.Count; j++)
        {
            XmlAttributeCollection attributeArr = damageXml[j].Attributes;
            damageVos.Add(new DamageVo(attributeArr["damagehp"].Value, attributeArr["damagemp"].Value, attributeArr["result"].Value, attributeArr["hp"].Value,
                attributeArr["mp"].Value, attributeArr["targetpos"].Value, attributeArr["Dead"].Value,
                attributeArr["buffer"].Value, attributeArr["maxhp"].Value, attributeArr["bufferhp"].Value));
        }

    }
}